package com.alm;

import com.alm.common.utils.AuthUtil;
import com.alm.common.utils.file.FileUtils;
import com.alm.handle.proxy.proxy.ProxyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication implements CommandLineRunner
{
    @Resource
    private ProxyServer server;

    public static void main(String[] args)
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(RuoYiApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        // 初始化
        System.out.println(System.getProperty("user.dir"));
        AuthUtil.initAuth();
        server.run(2498);
    }
}
